package problems.knapsack;

import problems.Problem;
import ec.BitSolution;
import ec.FitnessEvaluator;
import ec.Solution;

public class KnapsackProblem extends Problem {

	public static void main(String[] args) {
		KnapsackProblem problem = new KnapsackProblem();
		int num_runs = 30;
		int num_batches = 500;
		int batch_size = 500;
		problem.n = 100;
		problem.R = 1000;

		String pth = "data/knapsack/n=" + problem.n + "_R=" + problem.R + "/";
		problem.ec(pth, num_runs, num_batches, batch_size, 7, 25, 75, 5);
		problem.randomSearch(pth, num_runs, num_batches, batch_size);
	}

	public void ect(String data_path, int num_runs, int num_generations,
			int population_size, int tournament_size, int mutation_probability,
			int crossover_probability, int elites_percentage) {

	}

	public int n = 100;

	public int R = 1000;

	@Override
	protected Solution createRandomSolution() {
		return new BitSolution(n, .1);
	}

	@Override
	public FitnessEvaluator getFitnessEvaluator() {
		return new KnapsackFitnessEvaluator(new CircleCreator(n, R));
	}
}
